package com.cskt.util;

/**
 * Created by bb on 2018/3/15.
 */
public class Pager {
    /**
     * 每页大小
     */
    private int  pageSize=3;
    /**
     * 单前页
     */
    private int currPage=1;
    /**
     * 总记录数
     */
    private int totalCounts;
    /**
     * 总页数
     */
    private int toatPages;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrPage() {

        return currPage;
    }

    public void setCurrPage(int currPage) {
        if(currPage<0){
            System.out.print(currPage);
            this.currPage =1;
        }
        this.currPage = currPage;
    }

    public int getTotalCounts() {
        return totalCounts;
    }

    public void setTotalCounts(int totalCounts) {
        this.totalCounts = totalCounts;
    }

    public int getToatPages() {
        return toatPages;
    }

    public void setToatPages(int toatPages) {
        this.toatPages = toatPages;
        this.toatPages=this.toatPages%this.pageSize==0?
                (this.toatPages/this.pageSize):
                (this.toatPages/this.pageSize+1);
    }
}
